var timeIDX = 0;
var time0 = 0;
var time1 = 1;
var startTime = 0;
var endTime = 1;
var elapsedTimesRaw = new Array(NUMMEASURES); //1 million...it's OVER 9000!!!

function displayResults() {
	endTime = performance.now();

	$('body').html('<pre><div id="results"></div></pre>');
	$('#results').append('Total time: '+(endTime - startTime)+'<br>');
	$('#results').append('index,timeVal,type<br>');
	
	if (version == 'noCL') {
		for (var i = 0; i < NUMMEASURES; i++) {
			$('#results').append(i+',');
			$('#results').append(elapsedTimesRaw[i]+',');
			switch(i%3) {
				case 0: 
					$('#results').append('compute<br>')
					break;
				case 1:
					$('#results').append('transfer<br>')
					break;
				case 2: 
					$('#results').append('display<br>')
					break;
			}
		}
	}
	if (version == 'withCL') {
		for (var i = 0; i < NUMMEASURES; i++) {
			$('#results').append(i+',');
			$('#results').append(elapsedTimesRaw[i]+',');
			switch(i%4) {
				case 0: 
					$('#results').append('compute<br>')
					break;
				case 1:
					$('#results').append('transfer<br>')
					break;
				case 2: 
					$('#results').append('transfer2<br>')
					break;
				case 3: 
					$('#results').append('display<br>')
					break;
			}
		}
	}
}